package interview.sharding.jdbc.service;

import interview.sharding.jdbc.dao.UserMapper;
import interview.sharding.jdbc.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class UserService {

    @Autowired
    private UserMapper userMapper;

    @Transactional
    public void qupdate() {
        Thread.getAllStackTraces();
        User user = userMapper.findById(1);
        user.setName(String.valueOf(System.currentTimeMillis()));
        userMapper.update(user);
    }
}
